package com.peycard.vista;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.peycard.common.CatalogRoleDTO;
import com.peycard.util.Constantes;

@Controller(Constantes.BEAN_ROLES)
@Scope(Constantes.SCOPE_REQUEST)
public class RolesControlador extends BaseController {

	private static final Logger LOGGER = LoggerFactory
			.getLogger(RolesControlador.class);
	private long idRole;
	private String abbreviation;
	private String description;
	private String roleName;
	private String token;
	private String username;
	private List<CatalogRoleDTO> listItems;
	private CatalogRoleDTO dto;

	public RolesControlador() {
		initRoleList();
		token = super.getTokenInContext();
		username = super.userLogged();
	}

	private void initRoleList() {
		dto = new CatalogRoleDTO();
		dto.setIdRole(new Long(1));
		dto.setAbbreviation("AdminUser");
		dto.setDescription("Es aquel responsable del mantenimiento/soporte  de la materia de los usuarios internos del comercio.");
		dto.setRoleName("Administrador de usuarios del portal web");
		listItems.add(dto);

		dto = new CatalogRoleDTO();
		dto.setIdRole(new Long(1));
		dto.setAbbreviation("AdminReport");
		dto.setDescription("Es la persona que tiene la responsabilidad de administrar y asegurar la información de las operaciones de adquirente del Switch.");
		dto.setRoleName("Administrador de reportes estadísticos");
		listItems.add(dto);

		dto = new CatalogRoleDTO();
		dto.setIdRole(new Long(1));
		dto.setAbbreviation("AdminConfig");
		dto.setDescription("Es aquel responsable del mantenimiento/soporte  de la materia prima del comercio.");
		dto.setRoleName("Administrador de configuración comercial");
		listItems.add(dto);
	}

	public long getIdRole() {
		return idRole;
	}

	public void setIdRole(long idRole) {
		this.idRole = idRole;
	}

	public String getAbbreviation() {
		return abbreviation;
	}

	public void setAbbreviation(String abbreviation) {
		this.abbreviation = abbreviation;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public List<CatalogRoleDTO> getListItems() {
		return listItems;
	}

	public void setListItems(List<CatalogRoleDTO> listItems) {
		this.listItems = listItems;
	}

	public CatalogRoleDTO getDto() {
		return dto;
	}

	public void setDto(CatalogRoleDTO dto) {
		this.dto = dto;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public static Logger getLogger() {
		return LOGGER;
	}

}
